home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / text / textutil.11 / textutil / usr / info / textutils.info
Encoding:
GNU Info File  |  1995-05-28  |  85.4 KB  |  2,339 lines

  1. This is Info file textutils.info, produced by Makeinfo-1.55 from the
  2. input file textutils.texi.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * Text utilities: (textutils).      GNU text utilities.
  6. * cat: (textutils)cat invocation.        Concatenate and write files.
  7. * tac: (textutils)tac invocation.        Reverse files.
  8. * nl: (textutils)nl invocation.            Number lines and write files.
  9. * od: (textutils)od invocation.            Dump files in octal, etc.
  10. * fmt: (textutils)fmt invocation.        Reformat paragraph text.
  11. * pr: (textutils)pr invocation.            Paginate or columnate files.
  12. * fold: (textutils)fold invocation.        Wrap long input lines.
  13. * head: (textutils)head invocation.        Output the first part of files.
  14. * tail: (textutils)tail invocation.        Output the last part of files.
  15. * split: (textutils)split invocation.        Split into fixed-size pieces.
  16. * csplit: (textutils)csplit invocation.        Split by context.
  17. * wc: (textutils)wc invocation.            Byte, word, and line counts.
  18. * sum: (textutils)sum invocation.        Print traditional checksum.
  19. * cksum: (textutils)cksum invocation.        Print POSIX CRC checksum.
  20. * sort: (textutils)sort invocation.        Sort text files.
  21. * uniq: (textutils)uniq invocation.        Uniqify files.
  22. * comm: (textutils)comm invocation.        Compare sorted files by line.
  23. * cut: (textutils)cut invocation.        Print selected parts of lines.
  24. * paste: (textutils)paste invocation.        Merge lines of files.
  25. * join: (textutils)join invocation.        Join lines on a common field.
  26. * tr: (textutils)tr invocation.            Translate characters.
  27. * expand: (textutils)expand invocation.        Convert tabs to spaces.
  28. * unexpand: (textutils)unexpand invocation.    Convert spaces to tabs.
  29. END-INFO-DIR-ENTRY
  30.  
  31.    This file documents the GNU text utilities.
  32.  
  33.    Copyright (C) 1994 Free Software Foundation, Inc.
  34.  
  35.    Permission is granted to make and distribute verbatim copies of this
  36. manual provided the copyright notice and this permission notice are
  37. preserved on all copies.
  38.  
  39.    Permission is granted to copy and distribute modified versions of
  40. this manual under the conditions for verbatim copying, provided that
  41. the entire resulting derived work is distributed under the terms of a
  42. permission notice identical to this one.
  43.  
  44.    Permission is granted to copy and distribute translations of this
  45. manual into another language, under the above conditions for modified
  46. versions, except that this permission notice may be stated in a
  47. translation approved by the Foundation.
  48.  
  49. 
  50. File: textutils.info,  Node: Top,  Next: Introduction,  Prev: (DIR),  Up: (DIR)
  51.  
  52. GNU text utilities
  53. ******************
  54.  
  55.    This manual minimally documents version GNU textutils 1.11 of the
  56. GNU text utilities.
  57.  
  58. * Menu:
  59.  
  60. * Introduction::                        Caveats, overview, and authors.
  61. * Common options::                      Common options.
  62. * Output of entire files::        cat tac nl od
  63. * Formatting file contents::            fmt pr fold
  64. * Output of parts of files::        head tail split csplit
  65. * Summarizing files::            wc sum cksum
  66. * Operating on sorted files::        sort uniq comm
  67. * Operating on fields within a line::    cut paste join
  68. * Operating on characters::        tr expand unexpand
  69. * Index::                General index.
  70.  
  71. 
  72. File: textutils.info,  Node: Introduction,  Next: Common options,  Prev: Top,  Up: Top
  73.  
  74. Introduction
  75. ************
  76.  
  77.    This manual is incomplete: No attempt is made to explain basic
  78. concepts in a way suitable for novices.  Thus, if you are interested,
  79. please get involved in improving this manual.  The entire GNU community
  80. will benefit.
  81.  
  82.    The GNU text utilities are mostly compatible with the POSIX.2
  83. standard.
  84.  
  85.    Please report bugs to `bug-gnu-utils@prep.ai.mit.edu'.  Remember to
  86. include the version number, machine architecture, input files, and any
  87. other information needed to reproduce the bug.  *Note Bugs: (gcc)Bugs.
  88.  
  89.    This manual is based on the Unix man pages in the distribution, which
  90. were originally written by David MacKenzie and updated by Jim Meyering.
  91. The original `fmt' man page was written by Ross Paterson.   Franc,ois
  92. Pinard did the initial conversion to Texinfo format.  Karl Berry did
  93. the indexing, some reorganization, and editing of the results.  Richard
  94. Stallman contributed his usual invaluable insights to the overall
  95. process.
  96.  
  97. 
  98. File: textutils.info,  Node: Common options,  Next: Output of entire files,  Prev: Introduction,  Up: Top
  99.  
  100. Common options
  101. **************
  102.  
  103.    Certain options are available in all these programs.  Rather than
  104. writing identical descriptions for each of the programs, they are
  105. described here.  (In fact, every GNU program accepts (or should accept)
  106. these options.)
  107.  
  108.    A few of these programs take arbitrary strings as arguments.  In
  109. those cases, `--help' and `--version' are taken as these options only
  110. if there is one and exactly one command line argument.
  111.  
  112. `--help'
  113.      Print a usage message listing all available options, then exit
  114.      successfully.
  115.  
  116. `--version'
  117.      Print the version number, then exit successfully.
  118.  
  119. 
  120. File: textutils.info,  Node: Output of entire files,  Next: Formatting file contents,  Prev: Common options,  Up: Top
  121.  
  122. Output of entire files
  123. **********************
  124.  
  125.    These commands read and write entire files, possibly transforming
  126. them in some way.
  127.  
  128. * Menu:
  129.  
  130. * cat invocation::              Concatenate and write files.
  131. * tac invocation::              Concatenate and write files in reverse.
  132. * nl invocation::               Number lines and write files.
  133. * od invocation::               Write files in octal or other formats.
  134.  
  135. 
  136. File: textutils.info,  Node: cat invocation,  Next: tac invocation,  Up: Output of entire files
  137.  
  138. `cat': Concatenate and write files
  139. ==================================
  140.  
  141.    `cat' copies each FILE (`-' means standard input), or standard input
  142. if none are given, to standard output.  Synopsis:
  143.  
  144.      cat [OPTION] [FILE]...
  145.  
  146.    The program accepts the following options.  Also see *Note Common
  147. options::.
  148.  
  149. `-A'
  150. `--show-all'
  151.      Equivalent to `-vET'.
  152.  
  153. `-b'
  154. `--number-nonblank'
  155.      Number all nonblank output lines, starting with 1.
  156.  
  157. `-e'
  158.      Equivalent to `-vE'.
  159.  
  160. `-E'
  161. `--show-ends'
  162.      Display a `$' after the end of each line.
  163.  
  164. `-n'
  165. `--number'
  166.      Number all output lines, starting with 1.
  167.  
  168. `-s'
  169. `--squeeze-blank'
  170.      Replace multiple adjacent blank lines with a single blank line.
  171.  
  172. `-t'
  173.      Equivalent to `-vT'.
  174.  
  175. `-T'
  176. `--show-tabs'
  177.      Display TAB characters as `^I'.
  178.  
  179. `-u'
  180.      Ignored; for Unix compatibility.
  181.  
  182. `-v'
  183. `--show-nonprinting'
  184.      Display control characters except for LFD and TAB using `^'
  185.      notation and precede characters that have the high bit set with
  186.      `M-'.
  187.  
  188. 
  189. File: textutils.info,  Node: tac invocation,  Next: nl invocation,  Prev: cat invocation,  Up: Output of entire files
  190.  
  191. `tac': Concatenate and write files in reverse
  192. =============================================
  193.  
  194.    `tac' copies each FILE (`-' means standard input), or standard input
  195. if none are given, to standard output, reversing the records (lines by
  196. default) in each separately.  Synopsis:
  197.  
  198.      tac [OPTION]... [FILE]...
  199.  
  200.    "Records" are separated by instances of a string (newline by
  201. default)).  By default, this separator string is attached to the end of
  202. the record that it follows in the file.
  203.  
  204.    The program accepts the following options.  Also see *Note Common
  205. options::.
  206.  
  207. `-b'
  208. `--before'
  209.      The separator is attached to the beginning of the record that it
  210.      precedes in the file.
  211.  
  212. `-r'
  213. `--regex'
  214.      Treat the separator string as a regular expression.
  215.  
  216. `-s SEPARATOR'
  217. `--separator=SEPARATOR'
  218.      Use SEPARATOR as the record separator, instead of newline.
  219.  
  220. 
  221. File: textutils.info,  Node: nl invocation,  Next: od invocation,  Prev: tac invocation,  Up: Output of entire files
  222.  
  223. `nl': Number lines and write files
  224. ==================================
  225.  
  226.    `nl' writes each FILE (`-' means standard input), or standard input
  227. if none are given, to standard output, with line numbers added to some
  228. or all of the lines.  Synopsis:
  229.  
  230.      nl [OPTION]... [FILE]...
  231.  
  232.    `nl' decomposes its input into (logical) pages; by default, the line
  233. number is reset to 1 at the top of each logical page.  `nl' treats all
  234. of the input files as a single document; it does not reset line numbers
  235. or logical pages between files.
  236.  
  237.    A logical page consists of three sections: header, body, and footer.
  238. Any of the sections can be empty.  Each can be numbered in a different
  239. style from the others.
  240.  
  241.    The beginnings of the sections of logical pages are indicated in the
  242. input file by a line containing exactly one of these delimiter strings:
  243.  
  244. `\:\:\:'
  245.      start of header;
  246.  
  247. `\:\:'
  248.      start of body;
  249.  
  250. `\:'
  251.      start of footer.
  252.  
  253.    The two characters from which these strings are made can be changed
  254. from `\' and `:' via options (see below), but the pattern and length of
  255. each string cannot be changed.
  256.  
  257.    A section delimiter is replaced by an empty line on output.  Any text
  258. that comes before the first section delimiter string in the input file
  259. is considered to be part of a body section, so `nl' treats a file that
  260. contains no section delimiters as a single body section.
  261.  
  262.    The program accepts the following options.  Also see *Note Common
  263. options::.
  264.  
  265. `-b STYLE'
  266. `--body-numbering=STYLE'
  267.      Select the numbering style for lines in the body section of each
  268.      logical page.  When a line is not numbered, the current line number
  269.      is not incremented, but the line number separator character is
  270.      still prepended to the line.  The styles are:
  271.  
  272.     `a'
  273.           number all lines,
  274.  
  275.     `t'
  276.           number only nonempty lines (default for body),
  277.  
  278.     `n'
  279.           do not number lines (default for header and footer),
  280.  
  281.     `pREGEXP'
  282.           number only lines that contain a match for REGEXP.
  283.  
  284. `-d CD'
  285. `--section-delimiter=CD'
  286.      Set the section delimiter characters to CD; default is `\:'. If
  287.      only C is given, the second remains `:'.  (Remember to protect `\'
  288.      or other metacharacters from shell expansion with quotes or extra
  289.      backslashes.)
  290.  
  291. `-f STYLE'
  292. `--footer-numbering=STYLE'
  293.      Analogous to `--body-numbering'.
  294.  
  295. `-h STYLE'
  296. `--header-numbering=STYLE'
  297.      Analogous to `--body-numbering'.
  298.  
  299. `-i NUMBER'
  300. `--page-increment=NUMBER'
  301.      Increment line numbers by NUMBER (default 1).
  302.  
  303. `-l NUMBER'
  304. `--join-blank-lines=NUMBER'
  305.      Consider NUMBER (default 1) consecutive empty lines to be one
  306.      logical line for numbering, and only number the last one.  Where
  307.      fewer than NUMBER consecutive empty lines occur, do not number
  308.      them.  An empty line is one that contains no characters, not even
  309.      spaces or tabs.
  310.  
  311. `-n FORMAT'
  312. `--number-format=FORMAT'
  313.      Select the line numbering format (default is `rn'):
  314.  
  315.     `ln'
  316.           left justified, no leading zeros;
  317.  
  318.     `rn'
  319.           right justified, no leading zeros;
  320.  
  321.     `rz'
  322.           right justified, leading zeros.
  323.  
  324. `-p'
  325. `--no-renumber'
  326.      Do not reset the line number at the start of a logical page.
  327.  
  328. `-s STRING'
  329. `--number-separator=STRING'
  330.      Separate the line number from the text line in the output with
  331.      STRING (default is TAB).
  332.  
  333. `-v NUMBER'
  334. `--first-page=NUMBER'
  335.      Set the initial line number on each logical page to NUMBER
  336.      (default 1).
  337.  
  338. `-w NUMBER'
  339. `--number-width=NUMBER'
  340.      Use NUMBER characters for line numbers (default 6).
  341.  
  342. 
  343. File: textutils.info,  Node: od invocation,  Prev: nl invocation,  Up: Output of entire files
  344.  
  345. `od': Write files in octal or other formats
  346. ===========================================
  347.  
  348.    `od' writes an unambiguous representation of each FILE (`-' means
  349. standard input), or standard input if none are given.  Synopsis:
  350.  
  351.      od [OPTION]... [FILE]...
  352.      od -C [FILE] [[+]OFFSET [[+]LABEL]]
  353.  
  354.    Each line of output consists of the offset in the input, followed by
  355. groups of data from the file. By default, `od' prints the offset in
  356. octal, and each group of file data is two bytes of input printed as a
  357. single octal number.
  358.  
  359.    The program accepts the following options.  Also see *Note Common
  360. options::.
  361.  
  362. `-A RADIX'
  363. `--address-radix=RADIX'
  364.      Select the base in which file offsets are printed.  RADIX can be
  365.      one of the following:
  366.  
  367.     `d'
  368.           decimal;
  369.  
  370.     `o'
  371.           octal;
  372.  
  373.     `x'
  374.           hexadecimal;
  375.  
  376.     `n'
  377.           none (do not print offsets).
  378.  
  379.      The default is octal.
  380.  
  381. `-j BYTES'
  382. `--skip-bytes=BYTES'
  383.      Skip BYTES input bytes before formatting and writing.  If BYTES
  384.      begins with `0x' or `0X', it is interpreted in hexadecimal;
  385.      otherwise, if it begins with `0', in octal; otherwise, in decimal.
  386.      Appending `b' multiplies BYTES by 512, `k' by 1024, and `m' by
  387.      1048576.
  388.  
  389. `-N BYTES'
  390. `--read-bytes=BYTES'
  391.      Output at most BYTES bytes of the input.  Prefixes and suffixes on
  392.      `bytes' are interpreted as for the `-j' option.
  393.  
  394. `-s [N]'
  395. `--strings[=N]'
  396.      Instead of the normal output, output only "string constants": at
  397.      least N (3 by default) consecutive ASCII graphic characters,
  398.      followed by a null (zero) byte.
  399.  
  400. `-t TYPE'
  401. `--format=TYPE'
  402.      Select the format in which to output the file data.  TYPE is a
  403.      string of one or more of the below type indicator characters.  If
  404.      you include more than one type indicator character in a single TYPE
  405.      string, or use this option more than once, `od' writes one copy of
  406.      each output line using each of the data types that you specified,
  407.      in the order that you specified.
  408.  
  409.     `a'
  410.           named character,
  411.  
  412.     `c'
  413.           ASCII character or backslash escape,
  414.  
  415.     `d'
  416.           signed decimal,
  417.  
  418.     `f'
  419.           floating point,
  420.  
  421.     `o'
  422.           octal,
  423.  
  424.     `u'
  425.           unsigned decimal,
  426.  
  427.     `x'
  428.           hexadecimal.
  429.  
  430.      The type `a' outputs things like `sp' for space, `nl' for newline,
  431.      and `nul' for a null (zero) byte.  Type `c' outputs ` ', `\n', and
  432.      `\0', respectively.
  433.  
  434.      Except for types `a' and `c', you can specify the number of bytes
  435.      to use in interpreting each number in the given data type by
  436.      following the type indicator character with a decimal integer.
  437.      Alternately, you can specify the size of one of the C compiler's
  438.      built-in data types by following the type indicator character with
  439.      one of the following characters.  For integers (`d', `o', `u',
  440.      `x'):
  441.  
  442.     `C'
  443.           char,
  444.  
  445.     `S'
  446.           short,
  447.  
  448.     `I'
  449.           int,
  450.  
  451.     `L'
  452.           long.
  453.  
  454.      For floating point (`f'):
  455.  
  456.     F
  457.           float,
  458.  
  459.     D
  460.           double,
  461.  
  462.     L
  463.           long double.
  464.  
  465. `-v'
  466. `--output-duplicates'
  467.      Output consecutive lines that are identical.  By default, when two
  468.      or more consecutive output lines would be identical, `od' outputs
  469.      only the first line, and puts just an asterisk on the following
  470.      line to indicate the elision.
  471.  
  472. `-w [N]'
  473. `--width[=N]'
  474.      Dump `n' input bytes per output line.  This must be a multiple of
  475.      the least common multiple of the sizes associated with the
  476.      specified output types.  If N is omitted, the default is 32.  If
  477.      this option is not given at all, the default is 16.
  478.  
  479.    The next several options map the old, pre-POSIX format specification
  480. options to the corresponding POSIX format specs.  GNU `od' accepts any
  481. combination of old- and new-style options.  Format specification
  482. options accumulate.
  483.  
  484. `-a'
  485.      Output as named characters.  Equivalent to `-ta'.
  486.  
  487. `-b'
  488.      Output as octal bytes.  Equivalent to `-toC'.
  489.  
  490. `-c'
  491.      Output as ASCII characters or backslash escapes.  Equivalent to
  492.      `-tc'.
  493.  
  494. `-d'
  495.      Output as unsigned decimal shorts.  Equivalent to `-tu2'.
  496.  
  497. `-f'
  498.      Output as floats.  Equivalent to `-tfF'.
  499.  
  500. `-h'
  501.      Output as hexadecimal shorts.  Equivalent to `-tx2'.
  502.  
  503. `-i'
  504.      Output as decimal shorts.  Equivalent to `-td2'.
  505.  
  506. `-l'
  507.      Output as decimal longs.  Equivalent to `-td4'.
  508.  
  509. `-o'
  510.      Output as octal shorts.  Equivalent to `-to2'.
  511.  
  512. `-x'
  513.      Output as hexadecimal shorts.  Equivalent to `-tx2'.
  514.  
  515. `-C'
  516. `--traditional'
  517.      Recognize the pre-POSIX non-option arguments that traditional `od'
  518.      accepted.  The following syntax:
  519.  
  520.           od --traditional [FILE] [[+]OFFSET[.][b] [[+]LABEL[.][b]]]
  521.  
  522.      can be used to specify at most one file and optional arguments
  523.      specifying an offset and a pseudo-start address, LABEL.  By
  524.      default, OFFSET is interpreted as an octal number specifying how
  525.      many input bytes to skip before formatting and writing.  The
  526.      optional trailing decimal point forces the interpretation of
  527.      OFFSET as a decimal number.  If no decimal is specified and the
  528.      offset begins with `0x' or `0X' it is interpreted as a hexadecimal
  529.      number.  If there is a trailing `b', the number of bytes skipped
  530.      will be OFFSET multiplied by 512.  The LABEL argument is
  531.      interpreted just like OFFSET, but it specifies an initial
  532.      pseudo-address.  The pseudo-addresses are displayed in parentheses
  533.      following any normal address.
  534.  
  535. 
  536. File: textutils.info,  Node: Formatting file contents,  Next: Output of parts of files,  Prev: Output of entire files,  Up: Top
  537.  
  538. Formatting file contents
  539. ************************
  540.  
  541.    These commands reformat the contents of files.
  542.  
  543. * Menu:
  544.  
  545. * fmt invocation::        Reformat paragraph text.
  546. * pr invocation::               Paginate or columnate files for printing.
  547. * fold invocation::             Wrap input lines to fit in specified width.
  548.  
  549. 
  550. File: textutils.info,  Node: fmt invocation,  Next: pr invocation,  Up: Formatting file contents
  551.  
  552. `fmt': Reformat paragraph text
  553. ==============================
  554.  
  555.    `fmt' fills and joins lines to produce output lines of (at most) a
  556. given number of characters (75 by default).  Synopsis:
  557.  
  558.      fmt [OPTION]... [FILE]...
  559.  
  560.    `fmt' reads from the specified FILE arguments (or standard input if
  561. none), and writes to standard output.
  562.  
  563.    By default, blank lines, spaces between words, and indentation are
  564. preserved in the output; successive input lines with different
  565. indentation are not joined; tabs are expanded on input and introduced on
  566. output.
  567.  
  568.    `fmt' prefers breaking lines at the end of a sentence, and tries to
  569. avoid line breaks after the first word of a sentence or before the last
  570. word of a sentence.  A "sentence break" is defined as either the end of
  571. a paragraph or a word ending in any of `.?!', followed by two spaces or
  572. end of line, ignoring any intervening parentheses or quotes.  Like TeX,
  573. `fmt' reads entire "paragraphs" before choosing line breaks; the
  574. algorithm is a variant of that in "Breaking Paragraphs Into Lines"
  575. (Donald E. Knuth and Michael F. Plass, `Software--Practice and
  576. Experience', 11 (1981), 1119-1184).
  577.  
  578.    The program accepts the following options.  Also see *Note Common
  579. options::.
  580.  
  581. `-c'
  582. `--crown-margin'
  583.      "Crown margin" mode: preserve the indentation of the first two
  584.      lines within a paragraph, and align the left margin of each
  585.      subsequent line with that of the second line.
  586.  
  587. `-t'
  588. `--tagged-paragraph'
  589.      "Tagged paragraph" mode: like crown margin mode, except that if
  590.      indentation of the first line of a paragraph is the same as the
  591.      indentation of the second, the first line is treated as a one-line
  592.      paragraph.
  593.  
  594. `-s'
  595. `--split-only'
  596.      Split lines only.  Do not join short lines to form longer ones.
  597.      This prevents sample lines of code, and other such "formatted"
  598.      text from being unduly combined.
  599.  
  600. `-u'
  601. `--uniform-spacing'
  602.      Uniform spacing.  Reduce spacing between words to one space, and
  603.      spacing between sentences to two spaces.
  604.  
  605. `-WIDTH'
  606. `-w WIDTH'
  607. `--width=WIDTH'
  608.      Fill output lines up to WIDTH characters (default 75).  `fmt'
  609.      initially tries to make lines about 7% shorter than this, to give
  610.      it room to balance line lengths.
  611.  
  612. `-p PREFIX'
  613. `--prefix=PREFIX'
  614.      Only lines beginning with PREFIX (possibly preceded by whitespace)
  615.      are subject to formatting. The prefix and any preceding whitespace
  616.      is stripped for the formatting and then re-attached to each
  617.      formatted output line.  One use is to format certain kinds of
  618.      program comments, while leaving the code unchanged.
  619.  
  620. 
  621. File: textutils.info,  Node: pr invocation,  Next: fold invocation,  Prev: fmt invocation,  Up: Formatting file contents
  622.  
  623. `pr': Paginate or columnate files for printing
  624. ==============================================
  625.  
  626.    `pr' writes each FILE (`-' means standard input), or standard input
  627. if none are given, to standard output, paginating and optionally
  628. outputting in multicolumn format.  Synopsis:
  629.  
  630.      pr [OPTION]... [FILE]...
  631.  
  632.    By default, a 5-line header is printed: two blank lines; a line with
  633. the date, the filename, and the page count; and two more blank lines.  A
  634. five line footer (entirely) is also printed.
  635.  
  636.    Form feeds in the input cause page breaks in the output.
  637.  
  638.    The program accepts the following options.  Also see *Note Common
  639. options::.
  640.  
  641. `+PAGE'
  642.      Begin printing with page PAGE.
  643.  
  644. `-COLUMN'
  645.      Produce COLUMN-column output and print columns down.  The column
  646.      width is automatically decreased as COLUMN increases; unless you
  647.      use the `-w' option to increase the page width as well, this option
  648.      might well cause some input to be truncated.
  649.  
  650. `-a'
  651.      Print columns across rather than down.
  652.  
  653. `-b'
  654.      Balance columns on the last page.
  655.  
  656. `-c'
  657.      Print control characters using hat notation (e.g., `^G'); print
  658.      other unprintable characters in octal backslash notation.  By
  659.      default, unprintable characters are not changed.
  660.  
  661. `-d'
  662.      Double space the output.
  663.  
  664. `-e[IN-TABCHAR[IN-TABWIDTH]]'
  665.      Expand tabs to spaces on input.  Optional argument IN-TABCHAR is
  666.      the input tab character (default is TAB).  Second optional
  667.      argument IN-TABWIDTH is the input tab character's width (default
  668.      is 8).
  669.  
  670. `-f'
  671. `-F'
  672.      Use a formfeed instead of newlines to separate output pages.
  673.  
  674. `-h HEADER'
  675.      Replace the filename in the header with the string HEADER.
  676.  
  677. `-i[OUT-TABCHAR[OUT-TABWIDTH]]'
  678.      Replace spaces with tabs on output.  Optional argument OUT-TABCHAR
  679.      is the output tab character (default is TAB).  Second optional
  680.      argument OUT-TABWIDTH is the output tab character's width (default
  681.      is 8).
  682.  
  683. `-l N'
  684.      Set the page length to N (default 66) lines.  If N is less than
  685.      10, the headers and footers are omitted, as if the `-t' option had
  686.      been given.
  687.  
  688. `-m'
  689.      Print all files in parallel, one in each column.
  690.  
  691. `-n[NUMBER-SEPARATOR[DIGITS]]'
  692.      Precede each column with a line number; with parallel files (`-m'),
  693.      precede each line with a line number.  Optional argument
  694.      NUMBER-SEPARATOR is the character to print after each number
  695.      (default is TAB).  Optional argument DIGITS is the number of
  696.      digits per line number (default is 5).
  697.  
  698. `-o N'
  699.      Indent each line with N (default is zero) spaces wide, i.e., set
  700.      the left margin.  The total page width is `n' plus the width set
  701.      with the `-w' option.
  702.  
  703. `-r'
  704.      Do not print a warning message when an argument FILE cannot be
  705.      opened.  (The exit status will still be nonzero, however.)
  706.  
  707. `-s[C]'
  708.      Separate columns by the single character C.  If C is omitted, the
  709.      default is space; if this option is omitted altogether, the
  710.      default is TAB.
  711.  
  712. `-t'
  713.      Do not print the usual 5-line header and the 5-line footer on each
  714.      page, and do not fill out the bottoms of pages (with blank lines or
  715.      formfeeds).
  716.  
  717. `-v'
  718.      Print unprintable characters in octal backslash notation.
  719.  
  720. `-w N'
  721.      Set the page width to N (default is 72) columns.
  722.  
  723. 
  724. File: textutils.info,  Node: fold invocation,  Prev: pr invocation,  Up: Formatting file contents
  725.  
  726. `fold': Wrap input lines to fit in specified width
  727. ==================================================
  728.  
  729.    `fold' writes each FILE (`-' means standard input), or standard
  730. input if none are given, to standard output, breaking long lines.
  731. Synopsis:
  732.  
  733.      fold [OPTION]... [FILE]...
  734.  
  735.    By default, `fold' breaks lines wider than 80 columns. The output is
  736. split into as many lines as necessary.
  737.  
  738.    `fold' counts screen columns by default; thus, a tab may count more
  739. than one column, backspace decreases the column count, and carriage
  740. return sets the column to zero.
  741.  
  742.    The program accepts the following options.  Also see *Note Common
  743. options::.
  744.  
  745. `-b'
  746. `--bytes'
  747.      Count bytes rather than columns, so that tabs, backspaces, and
  748.      carriage returns are each counted as taking up one column, just
  749.      like other characters.
  750.  
  751. `-s'
  752. `--spaces'
  753.      Break at word boundaries: the line is broken after the last blank
  754.      before the maximum line length.  If the line contains no such
  755.      blanks, the line is broken at the maximum line length as usual.
  756.  
  757. `-w WIDTH'
  758. `--width=WIDTH'
  759.      Use a maximum line length of WIDTH columns instead of 80.
  760.  
  761. 
  762. File: textutils.info,  Node: Output of parts of files,  Next: Summarizing files,  Prev: Formatting file contents,  Up: Top
  763.  
  764. Output of parts of files
  765. ************************
  766.  
  767.    These commands output pieces of the input.
  768.  
  769. * Menu:
  770.  
  771. * head invocation::             Output the first part of files.
  772. * tail invocation::             Output the last part of files.
  773. * split invocation::            Split a file into fixed-size pieces.
  774. * csplit invocation::           Split a file into context-determined pieces.
  775.  
  776. 
  777. File: textutils.info,  Node: head invocation,  Next: tail invocation,  Up: Output of parts of files
  778.  
  779. `head': Output the first part of files
  780. ======================================
  781.  
  782.    `head' prints the first part (10 lines by default) of each FILE; it
  783. reads from standard input if no files are given or when given a FILE of
  784. `-'.  Synopses:
  785.  
  786.      head [OPTION]... [FILE]...
  787.      head -NUMBER [OPTION]... [FILE]...
  788.  
  789.    If more than one FILE is specicified, `head' prints a one-line
  790. header consisting of
  791.      ==> FILENAME <==
  792.  
  793. before the output for each FILE.
  794.  
  795.    `head' accepts two option formats: the new one, in which numbers are
  796. arguments to the options (`-q -n 1'), and the old one, in which the
  797. number precedes any option letters (`-1q').
  798.  
  799.    The program accepts the following options.  Also see *Note Common
  800. options::.
  801.  
  802. `-COUNTOPTIONS'
  803.      This option is only recognized if it is specified first.  COUNT is
  804.      a decimal number optionally followed by a size letter (`b', `k',
  805.      `m') as in `-c', or `l' to mean count by lines, or other option
  806.      letters (`cqv').
  807.  
  808. `-c BYTES'
  809. `--bytes=BYTES'
  810.      Print the first BYTES bytes, instead of initial lines.  Appending
  811.      `b' multiplies BYTES by 512, `k' by 1024, and `m' by 1048576.
  812.  
  813. `-n N'
  814. `--lines=N'
  815.      Output the first N lines.
  816.  
  817. `-q'
  818. `--quiet'
  819. `--silent'
  820.      Never print filename headers.
  821.  
  822. `-v'
  823. `--verbose'
  824.      Always print filename headers.
  825.  
  826. 
  827. File: textutils.info,  Node: tail invocation,  Next: split invocation,  Prev: head invocation,  Up: Output of parts of files
  828.  
  829. `tail': Output the last part of files
  830. =====================================
  831.  
  832.    `tail' prints the last part (10 lines by default) of each FILE; it
  833. reads from standard input if no files are given or when given a FILE of
  834. `-'.  Synopses:
  835.  
  836.      tail [OPTION]... [FILE]...
  837.      tail -NUMBER [OPTION]... [FILE]...
  838.      tail +NUMBER [OPTION]... [FILE]...
  839.  
  840.    If more than one FILE is specified, `tail' prints a one-line header
  841. consisting of
  842.      ==> FILENAME <==
  843.  
  844. before the output for each FILE.
  845.  
  846.    GNU `tail' can output any amount of data (some other versions of
  847. `tail' cannot).  It also has no `-r' option (print in reverse), since
  848. reversing a file is really a different job from printing the end of a
  849. file; BSD `tail' (which is the one with `-r') can only reverse files
  850. that are at most as large as its buffer, which is typically 32k.  A
  851. more reliable and versatile way to reverse files is the GNU `tac'
  852. command.
  853.  
  854.    `head' accepts two option formats: the new one, in which numbers are
  855. arguments to the options (`-n 1'), and the old one, in which the number
  856. precedes any option letters (`-1' or `+1').
  857.  
  858.    If any option-argument is a number N starting with a `+', `tail'
  859. begins printing with the Nth item from the start of each file, instead
  860. of from the end.
  861.  
  862.    The program accepts the following options.  Also see *Note Common
  863. options::.
  864.  
  865. `-COUNT'
  866. `+COUNT'
  867.      This option is only recognized if it is specified first.  COUNT is
  868.      a decimal number optionally followed by a size letter (`b', `k',
  869.      `m') as in `-c', or `l' to mean count by lines, or other option
  870.      letters (`cfqv').
  871.  
  872. `-c BYTES'
  873. `--bytes=BYTES'
  874.      Output the last BYTES bytes, instead of final lines.  Appending
  875.      `b' multiplies BYTES by 512, `k' by 1024, and `m' by 1048576.
  876.  
  877. `-f'
  878. `--follow'
  879.      Loop forever trying to read more characters at the end of the file,
  880.      presumably because the file is growing.  Ignored if reading from a
  881.      pipe.  If more than one file is given, `tail' prints a header
  882.      whenever it gets output from a different file, to indicate which
  883.      file that output is from.
  884.  
  885. `-n N'
  886. `--lines=N'
  887.      Output the last N lines.
  888.  
  889. `-q'
  890. `-quiet'
  891. `--silent'
  892.      Never print filename headers.
  893.  
  894. `-v'
  895. `--verbose'
  896.      Always print filename headers.
  897.  
  898. 
  899. File: textutils.info,  Node: split invocation,  Next: csplit invocation,  Prev: tail invocation,  Up: Output of parts of files
  900.  
  901. `split': Split a file into fixed-size pieces
  902. ============================================
  903.  
  904.    `split' creates output files containing consecutive sections of
  905. INPUT (standard input if none is given or INPUT is `-').  Synopsis:
  906.  
  907.      split [OPTION] [INPUT [PREFIX]]
  908.  
  909.    By default, `split' puts 1000 lines of INPUT (or whatever is left
  910. over for the last section), into each output file.
  911.  
  912.    The output files' names consist of PREFIX (`x' by default) followed
  913. by a group of letters `aa', `ab', and so on, such that concatenating
  914. the output files in sorted order by filename produces the original
  915. input file.  (If more than 676 output files are required, `split' uses
  916. `zaa', `zab', etc.)
  917.  
  918.    The program accepts the following options.  Also see *Note Common
  919. options::.
  920.  
  921. `-LINES'
  922. `-l LINES'
  923. `--lines=LINES'
  924.      Put LINES lines of INPUT into each output file.
  925.  
  926. `-b BYTES'
  927. `--bytes=BYTES'
  928.      Put the first BYTES bytes of INPUT into each output file.
  929.      Appending `b' multiplies BYTES by 512, `k' by 1024, and `m' by
  930.      1048576.
  931.  
  932. `-C BYTES'
  933. `--line-bytes=BYTES'
  934.      Put into each output file as many complete lines of INPUT as
  935.      possible without exceeding BYTES bytes.  For lines longer than
  936.      BYTES bytes, put BYTES bytes into each output file until less than
  937.      BYTES bytes of the line are left, then continue normally.  BYTES
  938.      has the same format as for the `--bytes' option.
  939.  
  940. 
  941. File: textutils.info,  Node: csplit invocation,  Prev: split invocation,  Up: Output of parts of files
  942.  
  943. `csplit': Split a file into context-determined pieces
  944. =====================================================
  945.  
  946.    `csplit' creates zero or more output files containing sections of
  947. INPUT (standard input if INPUT is `-').  Synopsis:
  948.  
  949.      csplit [OPTION]... INPUT PATTERN...
  950.  
  951.    The contents of the output files are determined by the PATTERN
  952. arguments, as detailed below.  An error occurs if a PATTERN argument
  953. refers to a nonexistent line of the input file (e.g., if no remaining
  954. line matches a given regular expression).  After every PATTERN has been
  955. matched, any remaining input is copied into one last output file.
  956.  
  957.    By default, `csplit' prints the number of bytes written to each
  958. output file after it has been created.
  959.  
  960.    The types of pattern arguments are:
  961.  
  962. `N'
  963.      Create an output file containing the input up to but not including
  964.      line N (a positive integer).  If followed by a repeat count, also
  965.      create an output file containing the next LINE lines of the input
  966.      file once for each repeat.
  967.  
  968. `/REGEXP/[OFFSET]'
  969.      Create an output file containing the current line up to (but not
  970.      including) the next line of the input file that contains a match
  971.      for REGEXP.  The optional OFFSET is a `+' or `-' followed by a
  972.      positive integer.  If it is given, the input up to the matching
  973.      line plus or minus OFFSET is put into the output file, and the
  974.      line after that begins the next section of input.
  975.  
  976. `%REGEXP%[OFFSET]'
  977.      Like the previous type, except that it does not create an output
  978.      file, so that section of the input file is effectively ignored.
  979.  
  980. `{REPEAT-COUNT}'
  981.      Repeat the previous pattern REPEAT-COUNT additional times.
  982.      REPEAT-COUNT can either be a positive integer or an asterisk,
  983.      meaning repeat as many times as necessary until the input is
  984.      exausted.
  985.  
  986.    The output files' names consist of a prefix (`xx' by default)
  987. followed by a suffix.  By default, the suffix is an ascending sequence
  988. of two-digit decimal numbers from `00' and up to `99'.  In any case,
  989. concatenating the output files in sorted order by file name produces
  990. the original input file.
  991.  
  992.    By default, if `csplit' encounters an error or receives a hangup,
  993. interrupt, quit, or terminate signal, it removes any output files that
  994. it has created so far before it exits.
  995.  
  996.    The program accepts the following options.  Also see *Note Common
  997. options::.
  998.  
  999. `-f PREFIX'
  1000. `--prefix=PREFIX'
  1001.      Use PREFIX as the output filename prefix.
  1002.  
  1003. `-b SUFFIX'
  1004. `--suffix=SUFFIX'
  1005.      Use SUFFIX as the output filename suffix.  When this option is
  1006.      specified, the suffix string must include exactly one
  1007.      `printf(3)'-style conversion specification, possibly including
  1008.      format specification flags, a field width, a precision
  1009.      specifications, or all of these kinds of modifiers.  The format
  1010.      letter must convert a binary integer argument to readable form;
  1011.      thus, only `d', `i', `u', `o', `x', and `X' conversions are
  1012.      allowed.  The entire SUFFIX is given (with the current output file
  1013.      number) to `sprintf(3)' to form the filename suffixes for each of
  1014.      the individual output files in turn.  If this option is used, the
  1015.      `--digits' option is ignored.
  1016.  
  1017. `-n DIGITS'
  1018. `--digits=DIGITS'
  1019.      Use output filenames containing numbers that are DIGITS digits
  1020.      long instead of the default 2.
  1021.  
  1022. `-k'
  1023. `--keep-files'
  1024.      Do not remove output files when errors are encountered.
  1025.  
  1026. `-z'
  1027. `--elide-empty-files'
  1028.      Suppress the generation of zero-length output files.  (In cases
  1029.      where the section delimiters of the input file are supposed to
  1030.      mark the first lines of each of the sections, the first output
  1031.      file will generally be a zero-length file unless you use this
  1032.      option.)  The output file sequence numbers always run
  1033.      consecutively starting from 0, even when this option is specified.
  1034.  
  1035. `-s'
  1036. `-q'
  1037. `--silent'
  1038. `--quiet'
  1039.      Do not print counts of output file sizes.
  1040.  
  1041. 
  1042. File: textutils.info,  Node: Summarizing files,  Next: Operating on sorted files,  Prev: Output of parts of files,  Up: Top
  1043.  
  1044. Summarizing files
  1045. *****************
  1046.  
  1047.    These commands generate just a few numbers representing entire
  1048. contents of files.
  1049.  
  1050. * Menu:
  1051.  
  1052. * wc invocation::               Print byte, word, and line counts.
  1053. * sum invocation::              Print checksum and block counts.
  1054. * cksum invocation::            Print CRC checksum and byte counts.
  1055.  
  1056. 
  1057. File: textutils.info,  Node: wc invocation,  Next: sum invocation,  Up: Summarizing files
  1058.  
  1059. `wc': Print byte, word, and line counts
  1060. =======================================
  1061.  
  1062.    `wc' counts the number of bytes, whitespace-separated words, and
  1063. newlines in each given FILE, or standard input if none are given or for
  1064. a FILE of `-'.  Synopsis:
  1065.  
  1066.      wc [OPTION]... [FILE]...
  1067.  
  1068.    `wc' prints one line of counts for each file, and if the file was
  1069. given as an argument, it prints the filename following the counts.  If
  1070. more than one FILE is given, `wc' prints a final line containing the
  1071. cumulative counts, with the filename `total'.  The counts are printed
  1072. in this order: lines, words, bytes.
  1073.  
  1074.    By default, `wc' prints all three counts.  Options can specify that
  1075. only certain counts be printed.  Options do not undo others previously
  1076. given, so
  1077.  
  1078.      wc --bytes --words
  1079.  
  1080. prints both the byte counts and the word counts.
  1081.  
  1082.    The program accepts the following options.  Also see *Note Common
  1083. options::.
  1084.  
  1085. `-c'
  1086. `--bytes'
  1087. `--chars'
  1088.      Print only the byte counts.
  1089.  
  1090. `-w'
  1091. `--words'
  1092.      Print only the word counts.
  1093.  
  1094. `-l'
  1095. `--lines'
  1096.      Print only the newline counts.
  1097.  
  1098. 
  1099. File: textutils.info,  Node: sum invocation,  Next: cksum invocation,  Prev: wc invocation,  Up: Summarizing files
  1100.  
  1101. `sum': Print checksum and block counts
  1102. ======================================
  1103.  
  1104.    `sum' computes a 16-bit checksum for each given FILE, or standard
  1105. input if none are given or for a FILE of `-'.  Synopsis:
  1106.  
  1107.      sum [OPTION]... [FILE]...
  1108.  
  1109.    `sum' prints the checksum for each FILE followed by the number of
  1110. blocks in the file (rounded up).  If more than one FILE is given,
  1111. filenames are also printed (by default).  (With the `--sysv' option,
  1112. corresponding file name are printed when there is at least one file
  1113. argument.)
  1114.  
  1115.    By default, GNU `sum' computes checksums using an algorithm
  1116. compatible with BSD `sum' and prints file sizes in units of 1024-byte
  1117. blocks.
  1118.  
  1119.    The program accepts the following options.  Also see *Note Common
  1120. options::.
  1121.  
  1122. `-r'
  1123.      Use the default (BSD compatible) algorithm.  This option is
  1124.      included for compatibility with the System V `sum'.  Unless `-s'
  1125.      was also given, it has no effect.
  1126.  
  1127. `-s'
  1128. `--sysv'
  1129.      Compute checksums using an algorithm compatible with System V
  1130.      `sum''s default, and print file sizes in units of 512-byte blocks.
  1131.  
  1132.    `sum' is provided for compatibility; the `cksum' program (see next
  1133. section) is preferable in new applications.
  1134.  
  1135. 
  1136. File: textutils.info,  Node: cksum invocation,  Prev: sum invocation,  Up: Summarizing files
  1137.  
  1138. `cksum': Print CRC checksum and byte counts
  1139. ===========================================
  1140.  
  1141.    `cksum' computes a cyclic redundancy check (CRC) checksum for each
  1142. given FILE, or standard input if none are given or for a FILE of `-'.
  1143. Synopsis:
  1144.  
  1145.    Synopsis:
  1146.  
  1147.      cksum [OPTION]... [FILE]...
  1148.  
  1149.    `cksum' prints the CRC for each file along with the number of bytes
  1150. in the file, and the filename unless no arguments were given.
  1151.  
  1152.    `cksum' is typically used to ensure that files have been transferred
  1153. by unreliable means (e.g., netnews) have not been corrupted, by
  1154. comparing the `cksum' output for the received files with the `cksum'
  1155. output for the original files (usually given in the distribution).
  1156.  
  1157.    The CRC algorithm is specified by the POSIX.2 standard.  It is not
  1158. compatible with the BSD or System V `sum' programs; it is more robust.
  1159.  
  1160. 
  1161. File: textutils.info,  Node: Operating on sorted files,  Next: Operating on fields within a line,  Prev: Summarizing files,  Up: Top
  1162.  
  1163. Operating on sorted files
  1164. *************************
  1165.  
  1166.    These commands work with (or produce) sorted files.
  1167.  
  1168. * Menu:
  1169.  
  1170. * sort invocation::             Sort text files.
  1171. * uniq invocation::             Uniqify files.
  1172. * comm invocation::             Compare two sorted files line by line.
  1173.  
  1174. 
  1175. File: textutils.info,  Node: sort invocation,  Next: uniq invocation,  Up: Operating on sorted files
  1176.  
  1177. `sort': Sort text files
  1178. =======================
  1179.  
  1180.    `sort' sorts, merges, or compares all the lines from the given
  1181. files, or standard input if none are given or for a FILE of `-'.  By
  1182. default, `sort' writes the results to standard output.  Synopsis:
  1183.  
  1184.      sort [OPTION]... [FILE]...
  1185.  
  1186.    `sort' has three modes of operation: sort (the default), merge, and
  1187. check for sortedness.  The following options change the operation mode:
  1188.  
  1189. `-c'
  1190.      Check whether the given files are already sorted: if they are not
  1191.      all sorted, print an error message and exit with a status of 1.
  1192.  
  1193. `-m'
  1194.      Merge the given files by sorting them as a group.  Each input file
  1195.      must always be individually sorted.  It always works to sort
  1196.      instead of merge; merging is provided because it is faster, in the
  1197.      case where it works.
  1198.  
  1199.    A pair of lines is compared as follows: if any key fields have been
  1200. specified, `sort' compares each pair of fields, in the order specified
  1201. on the command line, according to the associated ordering options,
  1202. until a difference is found or no fields are left.
  1203.  
  1204.    If any of the global options `Mbdfinr' are given but no key fields
  1205. are specified, `sort' compares the entire lines according to the global
  1206. options.
  1207.  
  1208.    Finally, as a last resort when all keys compare equal (or if no
  1209. ordering options were specified at all), `sort' compares the lines byte
  1210. by byte in machine collating sequence.  The last resort comparison
  1211. honors the `-r' global option.  The `-s' (stable) option disables this
  1212. last-resort comparison so that lines in which all fields compare equal
  1213. are left in their original relative order.  If no fields or global
  1214. options are specified, `-s' has no effect.
  1215.  
  1216.    GNU `sort' (as specified for all GNU utilities) has no limits on
  1217. input line length or restrictions on bytes allowed within lines.  In
  1218. addition, if the final byte of an input file is not a newline, GNU
  1219. `sort' silently supplies one.
  1220.  
  1221.    If the environment variable `TMPDIR' is set, `sort' uses its value
  1222. as the directory for temporary files instead of `/tmp'.  The `-T
  1223. TEMPDIR' option in turn overrides the environment variable.
  1224.  
  1225.    The following options affect the ordering of output lines.  They may
  1226. be specified globally or as part of a specific key field.  If no key
  1227. fields are specified, global options apply to comparison of entire
  1228. lines; otherwise the global options are inherited by key fields that do
  1229. not specify any special options of their own.
  1230.  
  1231. `-b'
  1232.      Ignore leading blanks when finding sort keys in each line.
  1233.  
  1234. `-d'
  1235.      Sort in "phone directory" order: ignore all characters except
  1236.      letters, digits and blanks when sorting.
  1237.  
  1238. `-f'
  1239.      Fold lowercase characters into the equivalent uppercase characters
  1240.      when sorting so that, for example, `b' and `B' sort as equal.
  1241.  
  1242. `-i'
  1243.      Ignore characters outside the printable ASCII range 040-0176 octal
  1244.      (inclusive) when sorting.
  1245.  
  1246. `-M'
  1247.      An initial string, consisting of any amount of whitespace, followed
  1248.      by three letters abbreviating a month name, is folded to UPPER
  1249.      case and compared in the order `JAN' < `FEB' < ... < `DEC'.
  1250.      Invalid names compare low to valid names.
  1251.  
  1252. `-n'
  1253.      Sort numerically: the number begins each line; specifically, it
  1254.      consists of optional whitespace, an optional `-' sign, and zero or
  1255.      more digits, optionally followed by a decimal point and zero or
  1256.      more digits.
  1257.  
  1258. `-r'
  1259.      Reverse the result of comparison, so that lines with greater key
  1260.      values appear earlier in the output instead of later.
  1261.  
  1262.    Other options are:
  1263.  
  1264. `-o OUTPUT-FILE'
  1265.      Write output to OUTPUT-FILE instead of standard output.  If
  1266.      OUTPUT-FILE is one of the input files, `sort' copies it to a
  1267.      temporary file before sorting and writing the output to
  1268.      OUTPUT-FILE.
  1269.  
  1270. `-t SEPARATOR'
  1271.      Use character SEPARATOR as the field separator when finding the
  1272.      sort keys in each line.  By default, fields are separated by the
  1273.      empty string between a non-whitespace character and a whitespace
  1274.      character.  That is, given the input line ` foo bar', `sort'
  1275.      breaks it into fields ` foo' and ` bar'.  The field separator is
  1276.      not considered to be part of either the field preceding or the
  1277.      field following.
  1278.  
  1279. `-u'
  1280.      For the default case or the `-m' option, only output the first of
  1281.      a sequence of lines that compare equal.  For the `-c' option,
  1282.      check that no pair of consecutive lines compares equal.
  1283.  
  1284. `+POS1[-POS2]'
  1285.      Specify a field within each line to use as a sorting key.  The
  1286.      field consists of the portion of the line starting at POS1 and up
  1287.      to (but not including) POS2 (or to the end of the line if POS2 is
  1288.      not given).  The fields and character positions are numbered
  1289.      starting with 0.
  1290.  
  1291. `-k POS1[,POS2]'
  1292.      An alternate syntax for specifying sorting keys.  The fields and
  1293.      character positions are numbered starting with 1.
  1294.  
  1295.    A position has the form `F.C', where F is the number of the field to
  1296. use and C is the number of the first character from the beginning of
  1297. the field (for `+POS') or from the end of the previous field (for
  1298. `-POS').  The `.C' part of a position may be omitted in which case it is
  1299. taken to be the first character in the field.  If the `-b' option has
  1300. been given, the `.C' part of a field specification is counted from the
  1301. first nonblank character of the field (for `+POS') or from the first
  1302. nonblank character following the previous field (for `-POS').
  1303.  
  1304.    A `+POS' or `-POS' argument may also have any of the option letters
  1305. `Mbdfinr' appended to it, in which case the global ordering options are
  1306. not used for that particular field.  The `-b' option may be
  1307. independently attached to either or both of the `+POS' and `-POS' parts
  1308. of a field specification, and if it is inherited from the global
  1309. options it will be attached to both.  If a `-n' or `-M' option is used,
  1310. thus implying a `-b' option, the `-b' option is taken to apply to both
  1311. the `+POS' and the `-POS' parts of a key specification.  Keys may span
  1312. multiple fields.
  1313.  
  1314.    In addition, when GNU `sort' is invoked with exactly one argument,
  1315. options `--help' and `--version' are recognized.  *Note Common
  1316. options::.
  1317.  
  1318.    Historical (BSD and System V) implementations of `sort' have
  1319. differed in their interpretation of some options, particularly `-b',
  1320. `-f', and `-n'.  GNU sort follows the POSIX behavior, which is usually
  1321. (but not always!) like the System V behavior.  According to POSIX, `-n'
  1322. no longer implies `-b'.  For consistency, `-M' has been changed in the
  1323. same way.  This may affect the meaning of character positions in field
  1324. specifications in obscure cases.  The only fix is to add an explicit
  1325. `-b'.
  1326.  
  1327. 
  1328. File: textutils.info,  Node: uniq invocation,  Next: comm invocation,  Prev: sort invocation,  Up: Operating on sorted files
  1329.  
  1330. `uniq': Uniqify files
  1331. =====================
  1332.  
  1333.    `uniq' writes the unique lines in the given `input', or standard
  1334. input if nothing is given or for an INPUT name of `-'.  Synopsis:
  1335.  
  1336.      uniq [OPTION]... [INPUT [OUTPUT]]
  1337.  
  1338.    By default, `uniq' prints the unique lines in a sorted file, i.e.,
  1339. discards all but one of identical successive lines.  Optionally, it can
  1340. instead show only lines that appear exactly once, or lines that appear
  1341. more than once.
  1342.  
  1343.    The input must be sorted.  If your input is not sorted, perhaps you
  1344. want to use `sort -u'.
  1345.  
  1346.    If no OUTPUT file is specified, `uniq' writes to standard output.
  1347.  
  1348.    The program accepts the following options.  Also see *Note Common
  1349. options::.
  1350.  
  1351. `-N'
  1352. `-f N'
  1353. `--skip-fields=N'
  1354.      Skip N fields on each line before checking for uniqueness.  Fields
  1355.      are sequences of non-space non-tab characters that are separated
  1356.      from each other by at least one spaces or tabs.
  1357.  
  1358. `+N'
  1359. `-s N'
  1360. `--skip-chars=N'
  1361.      Skip N characters before checking for uniqueness.  If you use both
  1362.      the field and character skipping options, fields are skipped over
  1363.      first.
  1364.  
  1365. `-c'
  1366. `--count'
  1367.      Print the number of times each line occurred along with the line.
  1368.  
  1369. `-d'
  1370. `--repeated'
  1371.      Print only duplicate lines.
  1372.  
  1373. `-u'
  1374. `--unique'
  1375.      Print only unique lines.
  1376.  
  1377. `-w N'
  1378. `--check-chars=N'
  1379.      Compare N characters on each line (after skipping any specified
  1380.      fields and characters).  By default the entire rest of the lines
  1381.      are compared.
  1382.  
  1383. 
  1384. File: textutils.info,  Node: comm invocation,  Prev: uniq invocation,  Up: Operating on sorted files
  1385.  
  1386. `comm': Compare two sorted files line by line
  1387. =============================================
  1388.  
  1389.    `comm' writes to standard output lines that are common, and lines
  1390. that are unique, to two input files; a filename of `-' means standard
  1391. input.  Synopsis:
  1392.  
  1393.      comm [OPTION]... FILE1 FILE2
  1394.  
  1395.    The input files must be sorted before `comm' can be used.
  1396.  
  1397.    With no options, `comm' produces three column output.  Column one
  1398. contains lines unique to FILE1, column two contains lines unique to
  1399. FILE2, and column three contains lines common to both files.
  1400.  
  1401.    The options `-1', `-2', and `-3' suppress printing of the
  1402. corresponding columns.  Also see *Note Common options::.
  1403.  
  1404. 
  1405. File: textutils.info,  Node: Operating on fields within a line,  Next: Operating on characters,  Prev: Operating on sorted files,  Up: Top
  1406.  
  1407. Operating on fields within a line
  1408. *********************************
  1409.  
  1410. * Menu:
  1411.  
  1412. * cut invocation::              Print selected parts of lines.
  1413. * paste invocation::            Merge lines of files.
  1414. * join invocation::             Join lines on a common field.
  1415.  
  1416. 
  1417. File: textutils.info,  Node: cut invocation,  Next: paste invocation,  Up: Operating on fields within a line
  1418.  
  1419. `cut': Print selected parts of lines
  1420. ====================================
  1421.  
  1422.    `cut' writes to standard output selected parts of each line of each
  1423. input file, or standard input if no files are given or for a filename of
  1424. `-'.  Synopsis:
  1425.  
  1426.      cut [OPTION]... [FILE]...
  1427.  
  1428.    In the table which follows, the BYTE-LIST, CHARACTER-LIST, and
  1429. FIELD-LIST are one or more numbers or ranges (two numbers separated by
  1430. a dash) separated by commas.  Bytes, characters, and fields are
  1431. numbered from starting at 1.  Incomplete ranges may be given: `-M'
  1432. means `1-M'; `N-' means `N' through end of line or last field.
  1433.  
  1434.    The program accepts the following options.  Also see *Note Common
  1435. options::.
  1436.  
  1437. `-b BYTE-LIST'
  1438. `--bytes=BYTE-LIST'
  1439.      Print only the bytes in positions listed in BYTE-LIST.  Tabs and
  1440.      backspaces are treated like any other character; they take up 1
  1441.      byte.
  1442.  
  1443. `-c CHARACTER-LIST'
  1444. `--characters=CHARACTER-LIST'
  1445.      Print only characters in positions listed in CHARACTER-LIST.  The
  1446.      same as `-b' for now, but internationalization will change that.
  1447.      Tabs and backspaces are treated like any other character; they
  1448.      take up 1 character.
  1449.  
  1450. `-f FIELD-LIST'
  1451. `--fields=FIELD-LIST'
  1452.      Print only the fields listed in FIELD-LIST.  Fields are separated
  1453.      by a TAB by default.
  1454.  
  1455. `-d DELIM'
  1456. `--delimiter=DELIM'
  1457.      For `-f', fields are separated by the first character in DELIM
  1458.      (default is TAB).
  1459.  
  1460. `-n'
  1461.      Do not split multibyte characters (no-op for now).
  1462.  
  1463. `-s'
  1464. `--only-delimited'
  1465.      For `-f', do not print lines that do not contain the field
  1466.      separator character.
  1467.  
  1468. 
  1469. File: textutils.info,  Node: paste invocation,  Next: join invocation,  Prev: cut invocation,  Up: Operating on fields within a line
  1470.  
  1471. `paste': Merge lines of files
  1472. =============================
  1473.  
  1474.    `paste' writes to standard output lines consisting of sequentially
  1475. corresponding lines of each given file, separated by TAB.  Standard
  1476. input is used for a filename of `-' or if no input files are given.
  1477.  
  1478.    Synopsis:
  1479.  
  1480.      paste [OPTION]... [FILE]...
  1481.  
  1482.    The program accepts the following options.  Also see *Note Common
  1483. options::.
  1484.  
  1485. `-s'
  1486. `--serial'
  1487.      Paste the lines of one file at a time rather than one line from
  1488.      each file.
  1489.  
  1490. `-d DELIM-LIST'
  1491. `--delimiters DELIM-LIST'
  1492.      Consecutively use the characters in DELIM-LIST instead of TAB to
  1493.      separate merged lines.  When DELIM-LIST is exhausted, start again
  1494.      at its beginning.
  1495.  
  1496. 
  1497. File: textutils.info,  Node: join invocation,  Prev: paste invocation,  Up: Operating on fields within a line
  1498.  
  1499. `join': Join lines on a common field
  1500. ====================================
  1501.  
  1502.    `join' writes to standard output a line for each pair of input lines
  1503. that have identical join fields.  Synopsis:
  1504.  
  1505.      join [OPTION]... FILE1 FILE2
  1506.  
  1507.    Either FILE1 or FILE2 (but not both) can be `-', meaning standard
  1508. input.  FILE1 and FILE2 should be already sorted in increasing order
  1509. (not numerically) on the join fields; unless the `-t' option is given,
  1510. they should be sorted ignoring blanks at the start of the line, as in
  1511. `sort -b'.
  1512.  
  1513.    The defaults are: the join field is the first field in each line;
  1514. fields in the input are separated by one or more blanks, with leading
  1515. blanks on the line ignored; fields in the output are separated by a
  1516. space; each output line consists of the join field, the remaining
  1517. fields from FILE1, then the remaining fields from FILE2.
  1518.  
  1519.    The program accepts the following options.  Also see *Note Common
  1520. options::.
  1521.  
  1522. `-a FILE-NUMBER'
  1523.      Print a line for each unpairable line in file FILE-NUMBER (either
  1524.      `1' or `2'), in addition to the normal output.
  1525.  
  1526. `-e STRING'
  1527.      Replace those output fields that are missing in the input with
  1528.      STRING.
  1529.  
  1530. `-1 FIELD'
  1531. `-j1 FIELD'
  1532.      Join on field FIELD (a positive integer) of file 1.
  1533.  
  1534. `-2 FIELD'
  1535. `-j2 FIELD'
  1536.      Join on field FIELD (a positive integer) of file 2.
  1537.  
  1538. `-j FIELD'
  1539.      Equivalent to `-1 FIELD -2 FIELD'.
  1540.  
  1541. `-o FIELD-LIST...'
  1542.      Construct each output line according to the format in FIELD-LIST.
  1543.      Each element in FIELD-LIST consists of a file number (either 1 or
  1544.      2), a period, and a field number (a positive integer).  The
  1545.      elements in the list are separated by commas or blanks.  Multiple
  1546.      FIELD-LIST arguments can be given after a single `-o' option; the
  1547.      values of all lists given with `-o' are concatenated together.
  1548.  
  1549. `-t CHAR'
  1550.      Use character CHAR as the input and output field separator.
  1551.  
  1552. `-v FILE-NUMBER'
  1553.      Print a line for each unpairable line in file FILE-NUMBER (either
  1554.      1 or 2), instead of the normal output.
  1555.  
  1556.    In addition, when GNU `join' is invoked with exactly one argument,
  1557. options `--help' and `--version' are recognized.  *Note Common
  1558. options::.
  1559.  
  1560. 
  1561. File: textutils.info,  Node: Operating on characters,  Next: Index,  Prev: Operating on fields within a line,  Up: Top
  1562.  
  1563. Operating on characters
  1564. ***********************
  1565.  
  1566.    This commands operate on individual characters.
  1567.  
  1568. * Menu:
  1569.  
  1570. * tr invocation::               Translate, squeeze, and/or delete characters.
  1571. * expand invocation::           Convert tabs to spaces.
  1572. * unexpand invocation::         Convert spaces to tabs.
  1573.  
  1574. 
  1575. File: textutils.info,  Node: tr invocation,  Next: expand invocation,  Up: Operating on characters
  1576.  
  1577. `tr': Translate, squeeze, and/or delete characters
  1578. ==================================================
  1579.  
  1580.    Synopsis:
  1581.  
  1582.      tr [OPTION]... SET1 [SET2]
  1583.  
  1584.    `tr' copies standard input to standard output, performing one of the
  1585. following operations:
  1586.  
  1587.    * translate, and optionally squeeze repeated characters in the
  1588.      result,
  1589.  
  1590.    * squeeze repeated characters,
  1591.  
  1592.    * delete characters,
  1593.  
  1594.    * delete characters, then squeeze repeated characters from the
  1595.      result.
  1596.  
  1597.    The SET1 and (if given) SET2 arguments define ordered sets of
  1598. characters, referred to below as SET1 and SET2.  These sets are the
  1599. characters of the input that `tr' operates on.  The `--complement'
  1600. (`-c') option replaces SET1 with its complement (all of the characters
  1601. that are not in SET1).
  1602.  
  1603. * Menu:
  1604.  
  1605. * Character sets::              Specifying sets of characters.
  1606. * Translating::                 Changing one characters to another.
  1607. * Squeezing::                   Squeezing repeats and deleting.
  1608. * Warnings in tr::              Warning messages.
  1609.  
  1610. 
  1611. File: textutils.info,  Node: Character sets,  Next: Translating,  Up: tr invocation
  1612.  
  1613. Specifying sets of characters
  1614. -----------------------------
  1615.  
  1616.    The format of the SET1 and SET2 arguments resembles the format of
  1617. regular expressions; however, they are not regular expressions, only
  1618. lists of characters.  Most characters simply represent themselves in
  1619. these strings, but the strings can contain the shorthands listed below,
  1620. for convenience.  Some of them can be used only in SET1 or SET2, as
  1621. noted below.
  1622.  
  1623. Backslash escapes.
  1624.      A backslash followed by a character not listed below causes an
  1625.      error message.
  1626.  
  1627.     `\a'
  1628.           Control-G,
  1629.  
  1630.     `\b'
  1631.           Control-H,
  1632.  
  1633.     `\f'
  1634.           Control-L,
  1635.  
  1636.     `\n'
  1637.           Control-J,
  1638.  
  1639.     `\r'
  1640.           Control-M,
  1641.  
  1642.     `\t'
  1643.           Control-I,
  1644.  
  1645.     `\v'
  1646.           Control-K,
  1647.  
  1648.     `\OOO'
  1649.           The character with the value given by OOO, which is 1 to 3
  1650.           octal digits,
  1651.  
  1652.     `\\'
  1653.           A backslash.
  1654.  
  1655. Ranges.
  1656.      The notation `M-N' expands to all of the characters from M through
  1657.      N, in ascending order.  M should collate before N; if it doesn't,
  1658.      an error results.  As an example, `0-9' is the same as
  1659.      `0123456789'.  Although GNU `tr' does not support the System V
  1660.      syntax that uses square brackets to enclose ranges, translations
  1661.      specified in that format will still work as long as the brackets
  1662.      in STRING1 correspond to identical brackets in STRING2.
  1663.  
  1664. Repeated characters.
  1665.      The notation `[C*N]' in SET2 expands to N copies of character C.
  1666.      Thus, `[y*6]' is the same as `yyyyyy'.  The notation `[C*]' in
  1667.      STRING2 expands to as many copies of C as are needed to make SET2
  1668.      as long as SET1.  If N begins with `0', it is interpreted in
  1669.      octal, otherwise in decimal.
  1670.  
  1671. Character classes.
  1672.      The notation `[:CLASS:]' expands to all of the characters in the
  1673.      (predefined) class CLASS.  The characters expand in no particular
  1674.      order, except for the `upper' and `lower' classes, which expand in
  1675.      ascending order.  When the `--delete' (`-d') and
  1676.      `--squeeze-repeats' (`-s') options are both given, any character
  1677.      class can be used in SET2.  Otherwise, only the character classes
  1678.      `lower' and `upper' are accepted in SET2, and then only if the
  1679.      corresponding character class (`upper' and `lower', respectively)
  1680.      is specified in the same relative position in SET1.  Doing this
  1681.      specifies case conversion.  The class names are given below; an
  1682.      error results when an invalid class name is given.
  1683.  
  1684.     `alnum'
  1685.           Letters and digits.
  1686.  
  1687.     `alpha'
  1688.           Letters.
  1689.  
  1690.     `blank'
  1691.           Horizontal whitespace.
  1692.  
  1693.     `cntrl'
  1694.           Control characters.
  1695.  
  1696.     `digit'
  1697.           Digits.
  1698.  
  1699.     `graph'
  1700.           Printable characters, not including space.
  1701.  
  1702.     `lower'
  1703.           Lowercase letters.
  1704.  
  1705.     `print'
  1706.           Printable characters, including space.
  1707.  
  1708.     `punct'
  1709.           Punctuation characters.
  1710.  
  1711.     `space'
  1712.           Horizontal or vertical whitespace.
  1713.  
  1714.     `upper'
  1715.           Uppercase letters.
  1716.  
  1717.     `xdigit'
  1718.           Hexadecimal digits.
  1719.  
  1720. Equivalence classes.
  1721.      The syntax `[=C=]' expands to all of the characters that are
  1722.      equivalent to C, in no particular order.  Equivalence classes are
  1723.      a relatively recent invention intended to support non-English
  1724.      alphabets.  But there seems to be no standard way to define them
  1725.      or determine their contents.  Therefore, they are not fully
  1726.      implemented in GNU `tr'; each character's equivalence class
  1727.      consists only of that character, which is of no particular use.
  1728.  
  1729. 
  1730. File: textutils.info,  Node: Translating,  Next: Squeezing,  Prev: Character sets,  Up: tr invocation
  1731.  
  1732. Translating
  1733. -----------
  1734.  
  1735.    `tr' performs translation when SET1 and SET2 are both given and the
  1736. `--delete' (`-d') option is not given.  `tr' translates each character
  1737. of its input that is in SET1 to the corresponding character in SET2.
  1738. Characters not in SET1 are passed through unchanged.  When a character
  1739. appears more than once in SET1 and the corresponding characters in SET2
  1740. are not all the same, only the final one is used.  For example, these
  1741. two commands are equivalent:
  1742.  
  1743.      tr aaa xyz
  1744.      tr a z
  1745.  
  1746.    A common use of `tr' is to convert lowercase characters to
  1747. uppercase.  This can be done in many ways.  Here are three of them:
  1748.  
  1749.      tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
  1750.      tr a-z A-Z
  1751.      tr '[:lower:]' '[:upper:]'
  1752.  
  1753.    When `tr' is performing translation, SET1 and SET2 typically have
  1754. the same length.  If SET1 is shorter than SET2, the extra characters at
  1755. the end of SET2 are ignored.
  1756.  
  1757.    On the other hand, making SET1 longer than SET2 is not portable;
  1758. POSIX.2 says that the result is undefined.  In this situation, BSD `tr'
  1759. pads SET2 to the length of SET1 by repeating the last character of SET2
  1760. as many times as necessary.  System V `tr' truncates SET1 to the length
  1761. of SET2.
  1762.  
  1763.    By default, GNU `tr' handles this case like BSD `tr'.  When the
  1764. `--truncate-set1' (`-t') option is given, GNU `tr' handles this case
  1765. like the System V `tr' instead.  This option is ignored for operations
  1766. other than translation.
  1767.  
  1768.    Acting like System V `tr' in this case breaks the relatively common
  1769. BSD idiom:
  1770.  
  1771.      tr -cs A-Za-z0-9 '\012'
  1772.  
  1773. because it converts only zero bytes (the first element in the
  1774. complement of SET1), rather than all non-alphanumerics, to newlines.
  1775.  
  1776. 
  1777. File: textutils.info,  Node: Squeezing,  Next: Warnings in tr,  Prev: Translating,  Up: tr invocation
  1778.  
  1779. Squeezing repeats and deleting
  1780. ------------------------------
  1781.  
  1782.    When given just the `--delete' (`-d') option, `tr' removes any input
  1783. characters that are in SET1.
  1784.  
  1785.    When given just the `--squeeze-repeats' (`-s') option, `tr' replaces
  1786. each input sequence of a repeated character that is in SET1 with a
  1787. single occurrence of that character.
  1788.  
  1789.    When given both `--delete' and `--squeeze-repeats', `tr' first
  1790. performs any deletions using SET1, then squeezes repeats from any
  1791. remaining characters using SET2.
  1792.  
  1793.    The `--squeeze-repeats' option may also be used when translating, in
  1794. which case `tr' first performs translation, then squeezes repeats from
  1795. any remaining characters using SET2.
  1796.  
  1797.    Here are some examples to illustrate various combinations of options:
  1798.  
  1799.    * Remove all zero bytes:
  1800.  
  1801.           tr -d '\000'
  1802.  
  1803.    * Put all words on lines by themselves.  This converts all
  1804.      non-alphanumeric characters to newlines, then squeezes each string
  1805.      of repeated newlines into a single newline:
  1806.  
  1807.           tr -cs '[a-zA-Z0-9]' '[\n*]'
  1808.  
  1809.    * Convert each sequence of repeated newlines to a single newline:
  1810.  
  1811.           tr -s '\n'
  1812.  
  1813. 
  1814. File: textutils.info,  Node: Warnings in tr,  Prev: Squeezing,  Up: tr invocation
  1815.  
  1816. Warning messages
  1817. ----------------
  1818.  
  1819.    Setting the environment variable `POSIXLY_CORRECT' turns off the
  1820. following warning and error messages, for strict compliance with
  1821. POSIX.2.  Otherwise, the following diagnostics are issued:
  1822.  
  1823.   1. When the `--delete' option is given but `--squeeze-repeats' is
  1824.      not, and SET2 is given, GNU `tr' by default prints a usage message
  1825.      and exits, because SET2 would not be used.  The POSIX
  1826.      specification says that SET2 must be ignored in this case.
  1827.      Silently ignoring arguments is a bad idea.
  1828.  
  1829.   2. When an ambiguous octal escape is given.  For example, `\400' is
  1830.      actually `\40' followed by the digit `0', because the value 400
  1831.      octal does not fit into a single byte.
  1832.  
  1833.  
  1834.    GNU `tr' does not provide complete BSD or System V compatibility.
  1835. For example, it is impossible to disable interpretation of the POSIX
  1836. constructs `[:alpha:]', `[=c=]', and `[c*10]'.  Also, GNU `tr' does not
  1837. delete zero bytes automatically, unlike traditional Unix versions,
  1838. which provide no way to preserve zero bytes.
  1839.  
  1840. 
  1841. File: textutils.info,  Node: expand invocation,  Next: unexpand invocation,  Prev: tr invocation,  Up: Operating on characters
  1842.  
  1843. `expand': Convert tabs to spaces
  1844. ================================
  1845.  
  1846.    `expand' writes the contents of each given FILE, or standard input
  1847. if none are given or for a FILE of `-', to standard output, with tab
  1848. characters converted to the appropriate number of spaces.  Synopsis:
  1849.  
  1850.      expand [OPTION]... [FILE]...
  1851.  
  1852.    By default, `expand' converts all tabs to spaces.  It preserves
  1853. backspace characters in the output; they decrement the column count for
  1854. tab calculations.  The default action is equivalent to `-8' (set tabs
  1855. every 8 columns).
  1856.  
  1857.    The program accepts the following options.  Also see *Note Common
  1858. options::.
  1859.  
  1860. `-TAB1[,TAB2]...'
  1861. `-t TAB1[,TAB2]...'
  1862. `--tabs=TAB1[,TAB2]...'
  1863.      If only one tab stop is given, set the tabs TAB1 spaces apart
  1864.      (default is 8).  Otherwise, set the tabs at columns TAB1, TAB2,
  1865.      ... (numbered from 0), and replace any tabs beyond the last
  1866.      tabstop given with single spaces.  If the tabstops are specified
  1867.      with the `-t' or `--tabs' option, they can be separated by blanks
  1868.      as well as by commas.
  1869.  
  1870. `-i'
  1871. `--initial'
  1872.      Only convert initial tabs (those that precede all non-space or
  1873.      non-tab characters) on each line to spaces.
  1874.  
  1875. 
  1876. File: textutils.info,  Node: unexpand invocation,  Prev: expand invocation,  Up: Operating on characters
  1877.  
  1878. `unexpand': Convert spaces to tabs
  1879. ==================================
  1880.  
  1881.    `unexpand' writes the contents of each given FILE, or standard input
  1882. if none are given or for a FILE of `-', to standard output, with
  1883. strings of two or more space or tab characters converted to as many
  1884. tabs as possible followed by as many spaces as are needed.  Synopsis:
  1885.  
  1886.      unexpand [OPTION]... [FILE]...
  1887.  
  1888.    By default, `unexpand' converts only initial spaces and tabs (those
  1889. that precede all non space or tab characters) on each line.  It
  1890. preserves backspace characters in the output; they decrement the column
  1891. count for tab calculations.  By default, tabs are set at every 8th
  1892. column.
  1893.  
  1894.    The program accepts the following options.  Also see *Note Common
  1895. options::.
  1896.  
  1897. `-TAB1[,TAB2]...'
  1898. `-t TAB1[,TAB2]...'
  1899. `--tabs=TAB1[,TAB2]...'
  1900.      If only one tab stop is given, set the tabs TAB1 spaces apart
  1901.      instead of the default 8.  Otherwise, set the tabs at columns
  1902.      TAB1, TAB2, ... (numbered from 0), and leave spaces and tabs
  1903.      beyond the tabstops given unchanged.  If the tabstops are specified
  1904.      with the `-t' or `--tabs' option, they can be separated by blanks
  1905.      as well as by commas.  This option implies the `-a' option.
  1906.  
  1907. `-a'
  1908. `--all'
  1909.      Convert all strings of two or more spaces or tabs, not just initial
  1910.      ones, to tabs.
  1911.  
  1912. 
  1913. File: textutils.info,  Node: Index,  Prev: Operating on characters,  Up: Top
  1914.  
  1915. Index
  1916. *****
  1917.  
  1918. * Menu:
  1919.  
  1920. * +COUNT:                               tail invocation.
  1921. * +N:                                   uniq invocation.
  1922. * -address-radix:                       od invocation.
  1923. * -all:                                 unexpand invocation.
  1924. * -before:                              tac invocation.
  1925. * -body-numbering:                      nl invocation.
  1926. * -bytes:                               tail invocation.
  1927. * -bytes:                               wc invocation.
  1928. * -bytes:                               fold invocation.
  1929. * -bytes:                               cut invocation.
  1930. * -bytes:                               head invocation.
  1931. * -bytes:                               split invocation.
  1932. * -characters:                          cut invocation.
  1933. * -chars:                               wc invocation.
  1934. * -check-chars:                         uniq invocation.
  1935. * -count:                               uniq invocation.
  1936. * -crown-margin:                        fmt invocation.
  1937. * -delimiter:                           cut invocation.
  1938. * -delimiters:                          paste invocation.
  1939. * -digits:                              csplit invocation.
  1940. * -elide-empty-files:                   csplit invocation.
  1941. * -fields:                              cut invocation.
  1942. * -first-page:                          nl invocation.
  1943. * -follow:                              tail invocation.
  1944. * -footer-numbering:                    nl invocation.
  1945. * -format:                              od invocation.
  1946. * -header-numbering:                    nl invocation.
  1947. * -help:                                Common options.
  1948. * -initial:                             expand invocation.
  1949. * -join-blank-lines:                    nl invocation.
  1950. * -keep-files:                          csplit invocation.
  1951. * -line-bytes:                          split invocation.
  1952. * -lines:                               head invocation.
  1953. * -lines:                               split invocation.
  1954. * -lines:                               wc invocation.
  1955. * -lines:                               tail invocation.
  1956. * -no-renumber:                         nl invocation.
  1957. * -number:                              cat invocation.
  1958. * -number-format:                       nl invocation.
  1959. * -number-nonblank:                     cat invocation.
  1960. * -number-separator:                    nl invocation.
  1961. * -number-width:                        nl invocation.
  1962. * -only-delimited:                      cut invocation.
  1963. * -output-duplicates:                   od invocation.
  1964. * -page-increment:                      nl invocation.
  1965. * -prefix:                              csplit invocation.
  1966. * -quiet:                               tail invocation.
  1967. * -quiet:                               csplit invocation.
  1968. * -quiet:                               head invocation.
  1969. * -read-bytes:                          od invocation.
  1970. * -regex:                               tac invocation.
  1971. * -repeated:                            uniq invocation.
  1972. * -section-delimiter:                   nl invocation.
  1973. * -separator:                           tac invocation.
  1974. * -serial:                              paste invocation.
  1975. * -show-all:                            cat invocation.
  1976. * -show-ends:                           cat invocation.
  1977. * -show-nonprinting:                    cat invocation.
  1978. * -show-tabs:                           cat invocation.
  1979. * -silent:                              csplit invocation.
  1980. * -silent:                              tail invocation.
  1981. * -silent:                              head invocation.
  1982. * -skip-bytes:                          od invocation.
  1983. * -skip-chars:                          uniq invocation.
  1984. * -skip-fields:                         uniq invocation.
  1985. * -spaces:                              fold invocation.
  1986. * -split-only:                          fmt invocation.
  1987. * -squeeze-blank:                       cat invocation.
  1988. * -strings:                             od invocation.
  1989. * -suffix:                              csplit invocation.
  1990. * -sysv:                                sum invocation.
  1991. * -tabs:                                unexpand invocation.
  1992. * -tabs:                                expand invocation.
  1993. * -tagged-paragraph:                    fmt invocation.
  1994. * -traditional:                         od invocation.
  1995. * -uniform-spacing:                     fmt invocation.
  1996. * -unique:                              uniq invocation.
  1997. * -verbose:                             tail invocation.
  1998. * -verbose:                             head invocation.
  1999. * -version:                             Common options.
  2000. * -width:                               od invocation.
  2001. * -width:                               fmt invocation.
  2002. * -width:                               fold invocation.
  2003. * -words:                               wc invocation.
  2004. * -1:                                   comm invocation.
  2005. * -1:                                   join invocation.
  2006. * -2:                                   join invocation.
  2007. * -2:                                   comm invocation.
  2008. * -3:                                   comm invocation.
  2009. * -COLUMN:                              pr invocation.
  2010. * -COUNT:                               tail invocation.
  2011. * -COUNT:                               head invocation.
  2012. * -N:                                   uniq invocation.
  2013. * -TAB:                                 expand invocation.
  2014. * -TAB:                                 unexpand invocation.
  2015. * -WIDTH:                               fmt invocation.
  2016. * -a:                                   pr invocation.
  2017. * -a:                                   unexpand invocation.
  2018. * -A:                                   od invocation.
  2019. * -a:                                   join invocation.
  2020. * -A:                                   cat invocation.
  2021. * -a:                                   od invocation.
  2022. * -b:                                   nl invocation.
  2023. * -b:                                   tac invocation.
  2024. * -b:                                   cut invocation.
  2025. * -b:                                   pr invocation.
  2026. * -b:                                   csplit invocation.
  2027. * -b:                                   od invocation.
  2028. * -b:                                   sort invocation.
  2029. * -b:                                   cat invocation.
  2030. * -b:                                   fold invocation.
  2031. * -b:                                   split invocation.
  2032. * -c:                                   od invocation.
  2033. * -C:                                   split invocation.
  2034. * -c:                                   wc invocation.
  2035. * -c:                                   tail invocation.
  2036. * -c:                                   sort invocation.
  2037. * -c:                                   cut invocation.
  2038. * -c:                                   head invocation.
  2039. * -c:                                   pr invocation.
  2040. * -c:                                   uniq invocation.
  2041. * -c:                                   fmt invocation.
  2042. * -d:                                   pr invocation.
  2043. * -d:                                   sort invocation.
  2044. * -d:                                   cut invocation.
  2045. * -d:                                   od invocation.
  2046. * -d:                                   paste invocation.
  2047. * -d:                                   uniq invocation.
  2048. * -d:                                   nl invocation.
  2049. * -E:                                   cat invocation.
  2050. * -e:                                   pr invocation.
  2051. * -e:                                   cat invocation.
  2052. * -e:                                   join invocation.
  2053. * -f:                                   tail invocation.
  2054. * -f:                                   pr invocation.
  2055. * -f:                                   uniq invocation.
  2056. * -f:                                   sort invocation.
  2057. * -f:                                   csplit invocation.
  2058. * -F:                                   pr invocation.
  2059. * -f:                                   od invocation.
  2060. * -f:                                   nl invocation.
  2061. * -f:                                   cut invocation.
  2062. * -h:                                   pr invocation.
  2063. * -h:                                   od invocation.
  2064. * -h:                                   nl invocation.
  2065. * -i:                                   expand invocation.
  2066. * -i:                                   od invocation.
  2067. * -i:                                   sort invocation.
  2068. * -i:                                   pr invocation.
  2069. * -i:                                   nl invocation.
  2070. * -j:                                   od invocation.
  2071. * -j1:                                  join invocation.
  2072. * -j2:                                  join invocation.
  2073. * -k:                                   csplit invocation.
  2074. * -l:                                   nl invocation.
  2075. * -l:                                   pr invocation.
  2076. * -l:                                   wc invocation.
  2077. * -l:                                   split invocation.
  2078. * -l:                                   od invocation.
  2079. * -m:                                   pr invocation.
  2080. * -M:                                   sort invocation.
  2081. * -m:                                   sort invocation.
  2082. * -n:                                   cut invocation.
  2083. * -n:                                   sort invocation.
  2084. * -n:                                   csplit invocation.
  2085. * -n:                                   pr invocation.
  2086. * -N:                                   od invocation.
  2087. * -n:                                   cat invocation.
  2088. * -n:                                   tail invocation.
  2089. * -n:                                   nl invocation.
  2090. * -n:                                   head invocation.
  2091. * -o:                                   od invocation.
  2092. * -o:                                   pr invocation.
  2093. * -o:                                   sort invocation.
  2094. * -p:                                   nl invocation.
  2095. * -q:                                   csplit invocation.
  2096. * -q:                                   head invocation.
  2097. * -q:                                   tail invocation.
  2098. * -r:                                   sum invocation.
  2099. * -r:                                   pr invocation.
  2100. * -r:                                   sort invocation.
  2101. * -r:                                   tac invocation.
  2102. * -s:                                   cut invocation.
  2103. * -s:                                   fold invocation.
  2104. * -s:                                   paste invocation.
  2105. * -s:                                   od invocation.
  2106. * -s:                                   cat invocation.
  2107. * -s:                                   fmt invocation.
  2108. * -s:                                   csplit invocation.
  2109. * -s:                                   sum invocation.
  2110. * -s:                                   tac invocation.
  2111. * -s:                                   uniq invocation.
  2112. * -s:                                   pr invocation.
  2113. * -s:                                   nl invocation.
  2114. * -t:                                   pr invocation.
  2115. * -t:                                   cat invocation.
  2116. * -T:                                   cat invocation.
  2117. * -t:                                   sort invocation.
  2118. * -t:                                   unexpand invocation.
  2119. * -t:                                   fmt invocation.
  2120. * -t:                                   expand invocation.
  2121. * -t:                                   od invocation.
  2122. * -u:                                   sort invocation.
  2123. * -u:                                   cat invocation.
  2124. * -u:                                   fmt invocation.
  2125. * -u:                                   uniq invocation.
  2126. * -v:                                   pr invocation.
  2127. * -v:                                   cat invocation.
  2128. * -v:                                   nl invocation.
  2129. * -v:                                   od invocation.
  2130. * -v:                                   tail invocation.
  2131. * -v:                                   head invocation.
  2132. * -w:                                   wc invocation.
  2133. * -w:                                   pr invocation.
  2134. * -w:                                   uniq invocation.
  2135. * -w:                                   od invocation.
  2136. * -w:                                   fold invocation.
  2137. * -w:                                   fmt invocation.
  2138. * -w:                                   nl invocation.
  2139. * -x:                                   od invocation.
  2140. * -z:                                   csplit invocation.
  2141. * 16-bit checksum:                      sum invocation.
  2142. * across columns:                       pr invocation.
  2143. * alnum:                                Character sets.
  2144. * alpha:                                Character sets.
  2145. * ASCII dump of files:                  od invocation.
  2146. * backslash escapes:                    Character sets.
  2147. * balancing columns:                    pr invocation.
  2148. * blank:                                Character sets.
  2149. * blank lines, numbering:               nl invocation.
  2150. * blanks, ignoring leading:             sort invocation.
  2151. * body, numbering:                      nl invocation.
  2152. * BSD sum:                              sum invocation.
  2153. * BSD tail:                             tail invocation.
  2154. * bugs, reporting:                      Introduction.
  2155. * byte count:                           wc invocation.
  2156. * case folding:                         sort invocation.
  2157. * cat:                                  cat invocation.
  2158. * characters classes:                   Character sets.
  2159. * checking for sortedness:              sort invocation.
  2160. * checksum, 16-bit:                     sum invocation.
  2161. * cksum:                                cksum invocation.
  2162. * cntrl:                                Character sets.
  2163. * comm:                                 comm invocation.
  2164. * common field, joining on:             join invocation.
  2165. * common lines:                         comm invocation.
  2166. * common options:                       Common options.
  2167. * comparing sorted files:               comm invocation.
  2168. * concatenate and write files:          cat invocation.
  2169. * context splitting:                    csplit invocation.
  2170. * converting tabs to spaces:            expand invocation.
  2171. * copying files:                        cat invocation.
  2172. * crown margin:                         fmt invocation.
  2173. * csplit:                               csplit invocation.
  2174. * cut:                                  cut invocation.
  2175. * cyclic redundancy check:              cksum invocation.
  2176. * deleting characters:                  Squeezing.
  2177. * differing lines:                      comm invocation.
  2178. * digit:                                Character sets.
  2179. * double spacing:                       pr invocation.
  2180. * duplicate lines, outputting:          uniq invocation.
  2181. * empty lines, numbering:               nl invocation.
  2182. * entire files, output of:              Output of entire files.
  2183. * equivalence classes:                  Character sets.
  2184. * expand:                               expand invocation.
  2185. * file contents, dumping unambiguously: od invocation.
  2186. * file offset radix:                    od invocation.
  2187. * first part of files, outputting:      head invocation.
  2188. * fmt:                                  fmt invocation.
  2189. * fold:                                 fold invocation.
  2190. * folding long input lines:             fold invocation.
  2191. * footers, numbering:                   nl invocation.
  2192. * formatting file contents:             Formatting file contents.
  2193. * graph:                                Character sets.
  2194. * growing files:                        tail invocation.
  2195. * head:                                 head invocation.
  2196. * headers, numbering:                   nl invocation.
  2197. * help, online:                         Common options.
  2198. * hex dump of files:                    od invocation.
  2199. * indenting lines:                      pr invocation.
  2200. * initial part of files, outputting:    head invocation.
  2201. * initial tabs, converting:             expand invocation.
  2202. * input tabs:                           pr invocation.
  2203. * introduction:                         Introduction.
  2204. * join:                                 join invocation.
  2205. * Knuth, Donald E.:                     fmt invocation.
  2206. * last part of files, outputting:       tail invocation.
  2207. * left margin:                          pr invocation.
  2208. * line count:                           wc invocation.
  2209. * line numbering:                       nl invocation.
  2210. * line-breaking:                        fmt invocation.
  2211. * line-by-line comparison:              comm invocation.
  2212. * ln format for nl:                     nl invocation.
  2213. * logical pages, numbering on:          nl invocation.
  2214. * lower:                                Character sets.
  2215. * merging files:                        paste invocation.
  2216. * merging sorted files:                 sort invocation.
  2217. * months, sorting by:                   sort invocation.
  2218. * multicolumn output, generating:       pr invocation.
  2219. * nl:                                   nl invocation.
  2220. * numbering lines:                      nl invocation.
  2221. * numeric sort:                         sort invocation.
  2222. * octal dump of files:                  od invocation.
  2223. * od:                                   od invocation.
  2224. * operating on characters:              Operating on characters.
  2225. * operating on sorted files:            Operating on sorted files.
  2226. * output filename prefix:               csplit invocation.
  2227. * output filename prefix:               split invocation.
  2228. * output filename suffix:               csplit invocation.
  2229. * output of entire files:               Output of entire files.
  2230. * output of parts of files:             Output of parts of files.
  2231. * output tabs:                          pr invocation.
  2232. * overwriting of input, allowed:        sort invocation.
  2233. * paragraphs, reformatting:             fmt invocation.
  2234. * parts of files, output of:            Output of parts of files.
  2235. * paste:                                paste invocation.
  2236. * phone directory order:                sort invocation.
  2237. * pieces, splitting a file into:        split invocation.
  2238. * Plass, Michael F.:                    fmt invocation.
  2239. * POSIX.2:                              Introduction.
  2240. * POSIXLY_CORRECT:                      Warnings in tr.
  2241. * pr:                                   pr invocation.
  2242. * print:                                Character sets.
  2243. * printing, preparing files for:        pr invocation.
  2244. * punct:                                Character sets.
  2245. * radix for file offsets:               od invocation.
  2246. * ranges:                               Character sets.
  2247. * reformatting paragraph text:          fmt invocation.
  2248. * repeated characters:                  Character sets.
  2249. * reverse sorting:                      sort invocation.
  2250. * reversing files:                      tac invocation.
  2251. * rn format for nl:                     nl invocation.
  2252. * rz format for nl:                     nl invocation.
  2253. * screen columns:                       fold invocation.
  2254. * section delimiters of pages:          nl invocation.
  2255. * sentences and line-breaking:          fmt invocation.
  2256. * sort:                                 sort invocation.
  2257. * sorted files, operations on:          Operating on sorted files.
  2258. * sorting files:                        sort invocation.
  2259. * space:                                Character sets.
  2260. * specifying sets of characters:        Character sets.
  2261. * split:                                split invocation.
  2262. * splitting a file into pieces:         split invocation.
  2263. * splitting a file into pieces by context: csplit invocation.
  2264. * squeezing blank lines:                cat invocation.
  2265. * squeezing repeat characters:          Squeezing.
  2266. * string constants, outputting:         od invocation.
  2267. * sum:                                  sum invocation.
  2268. * summarizing files:                    Summarizing files.
  2269. * System V sum:                         sum invocation.
  2270. * tabs to spaces, converting:           expand invocation.
  2271. * tabstops, setting:                    expand invocation.
  2272. * tac:                                  tac invocation.
  2273. * tagged paragraphs:                    fmt invocation.
  2274. * tail:                                 tail invocation.
  2275. * telephone directory order:            sort invocation.
  2276. * text utilities:                       Top.
  2277. * text, reformatting:                   fmt invocation.
  2278. * TMPDIR:                               sort invocation.
  2279. * total counts:                         wc invocation.
  2280. * tr:                                   tr invocation.
  2281. * translating characters:               Translating.
  2282. * type size:                            od invocation.
  2283. * unexpand:                             unexpand invocation.
  2284. * uniq:                                 uniq invocation.
  2285. * uniqify files:                        uniq invocation.
  2286. * unique lines, outputting:             uniq invocation.
  2287. * unprintable characters, ignoring:     sort invocation.
  2288. * upper:                                Character sets.
  2289. * utilities for text handling:          Top.
  2290. * version number, finding:              Common options.
  2291. * wc:                                   wc invocation.
  2292. * word count:                           wc invocation.
  2293. * wrapping long input lines:            fold invocation.
  2294. * xdigit:                               Character sets.
  2295.  
  2296.  
  2297. 
  2298. Tag Table:
  2299. Node: Top2386
  2300. Node: Introduction3092
  2301. Node: Common options4154
  2302. Node: Output of entire files4877
  2303. Node: cat invocation5409
  2304. Node: tac invocation6501
  2305. Node: nl invocation7480
  2306. Node: od invocation11145
  2307. Node: Formatting file contents16711
  2308. Node: fmt invocation17149
  2309. Node: pr invocation19842
  2310. Node: fold invocation23258
  2311. Node: Output of parts of files24500
  2312. Node: head invocation25007
  2313. Node: tail invocation26415
  2314. Node: split invocation28794
  2315. Node: csplit invocation30316
  2316. Node: Summarizing files34349
  2317. Node: wc invocation34809
  2318. Node: sum invocation35966
  2319. Node: cksum invocation37278
  2320. Node: Operating on sorted files38211
  2321. Node: sort invocation38633
  2322. Node: uniq invocation45382
  2323. Node: comm invocation46987
  2324. Node: Operating on fields within a line47757
  2325. Node: cut invocation48157
  2326. Node: paste invocation49858
  2327. Node: join invocation50700
  2328. Node: Operating on characters52983
  2329. Node: tr invocation53406
  2330. Node: Character sets54523
  2331. Node: Translating58119
  2332. Node: Squeezing59916
  2333. Node: Warnings in tr61153
  2334. Node: expand invocation62286
  2335. Node: unexpand invocation63603
  2336. Node: Index65038
  2337. 
  2338. End Tag Table
  2339.